import Axios from 'axios'

export default{
    namespaced:true,
    state:{
        detail:[]
    },
    mutations:{
        setState(state,payload){
            state.detail=payload
        }
    },
    actions:{
        async requestClassicDail(context,id){
            const {data} = await Axios.get('/data/classicsDetail.json')
            const result= data.filter(item=>item.id==id)
            context.commit('setState',result)
        }
    }
}